<?php

use Illuminate\Database\Seeder;
use  Carbon\Carbon;

class MenuDataSeeder extends Seeder
{
    /**
     * Run the database seeds_
     *
     * @return void
     */
    public function run()
    {
        // 主菜单数据
        DB::table('menus')->insert([
            [
                'code' => 'm100',
                'name' => '控制台',
                'parent_code' => '0',
                'iconfont' => '&#xe615;',
                'show_level' => 0,
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'menu_system'
            ],
            [
                'code' => 'm200',
                'name' => '基础数据',
                'parent_code' => '0',
                'iconfont' => '&#xe6c2;',
                'show_level' => 1,
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'menu_basicData'
            ],

            // 「信息发布」菜单项
            [
                'code' => 'm300',
                'name' => '信息发布',
                'parent_code' => '0',
                'iconfont' => '&#xe608;',
                'show_level' => 2,
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'menu_information'
            ],

            [
                'code' => 'm400',
                'name' => '系统设置',
                'parent_code' => '0',
                'iconfont' => '&#xe63a;',
                'show_level' => 3,
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'menu_setting'
            ]
        ]);

        // 子菜单数据
        DB::table('submenus')->insert([
            [
                'code' => 'sm100',
                'name' => '个人中心',
                'parent_code' => '0',
                'menu_code' => 'm100',
                'iconfont' => '&#xe600;',
                'url' => '',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'menu_system_personal'
            ],
            [
                'code' => 'sm101',
                'name' => '个人信息',
                'parent_code' => 'sm100',
                'menu_code' => 'm100',
                'iconfont' => '&#xe62d;',
                'url' => 'profile/',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'system_personal_info_show'
            ],
            [
                'code' => 'sm102',
                'name' => '修改密码',
                'parent_code' => 'sm100',
                'menu_code' => 'm100',
                'iconfont' => '&#xe606;',
                'url' => 'password/',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'system_personal_modify_pwd_show'
            ],
            [
                'code' => 'sm110',
                'name' => '消息中心',
                'parent_code' => '0',
                'menu_code' => 'm100',
                'iconfont' => '&#xe610;',
                'url' => '',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'menu_system_message'
            ],
            [
                'code' => 'sm111',
                'name' => '系统消息',
                'parent_code' => 'sm110',
                'menu_code' => 'm100',
                'iconfont' => '&#xe605;',
                'url' => 'message/',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'system_message_system_show'
            ],
            [
                'code' => 'sm200',
                'name' => '基础数据',
                'parent_code' => '0',
                'menu_code' => 'm200',
                'iconfont' => '&#xe6ed;',
                'url' => '',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'menu_basicData_basicData'
            ],
            [
                'code' => 'sm201',
                'name' => '客户',
                'parent_code' => 'sm200',
                'menu_code' => 'm200',
                'iconfont' => '&#xe609;',
                'url' => '/customers/index',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'basicData_customer_show'
            ],
            [
                'code' => 'sm202',
                'name' => '维护人员',
                'parent_code' => 'sm200',
                'menu_code' => 'm200',
                'iconfont' => '&#xe642;',
                'url' => '/maintainers/index',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'basicData_maintainer_show'
            ],
//            [
//                'code' => 'sm203',
//                'name' => '变电站',
//                'parent_code' => 'sm200',
//                'menu_code' => 'm200',
//                'iconfont' => '&#xe602;',
//                'url' => '/substations/index',
//                'created_at' => Carbon::now()->toDateTimeString(),
//                'updated_at' => Carbon::now()->toDateTimeString(),
//                'slug' =>'basicData_substation_show'
//            ],
            [
                'code' => 'sm204',
                'name' => '变压器',
                'parent_code' => 'sm200',
                'menu_code' => 'm200',
                'iconfont' => '&#xe63c;',
                'url' => '/transformers/index',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'basicData_transformer_show'
            ],
            [
                'code' => 'sm205',
                'name' => '采集器',
                'parent_code' => 'sm200',
                'menu_code' => 'm200',
                'iconfont' => '&#xe61a;',
                'url' => '/collectors/index',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'basicData_collector_show'
            ],
            [
                'code' => 'sm210',
                'name' => '业务数据',
                'parent_code' => '0',
                'menu_code' => 'm200',
                'iconfont' => '&#xe607;',
                'url' => '',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'menu_basicData_professional'
            ],
            [
                'code' => 'sm211',
                'name' => '采集数据',
                'parent_code' => 'sm210',
                'menu_code' => 'm200',
                'iconfont' => '&#xe68e;',
                'url' => '/collectData/index',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'basicData_collect_transformers_show'
            ],
            [
                'code' => 'sm212',
                'name' => '下载表格',
                'parent_code' => 'sm210',
                'menu_code' => 'm200',
                'iconfont' => '&#xe791;',
                'url' => '/export/index',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'basicData_collect_transformers_download'
            ],

            /****
             * 系统设置->用户权限
             */
            [
                'code' => 'sm400',
                'name' => '用户权限',
                'parent_code' => '0',
                'menu_code' => 'm400',
                'iconfont' => '&#xe612;',
                'url' => '',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'menu_setting_permission'
            ],
            [
                'code' => 'sm401',
                'name' => '用户管理',
                'parent_code' => 'sm400',
                'menu_code' => 'm400',
                'iconfont' => '&#xe619;',
                'url' => '/users/index',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'setting_permission_users_show'
            ],
            [
                'code' => 'sm402',
                'name' => '角色管理',
                'parent_code' => 'sm400',
                'menu_code' => 'm400',
                'iconfont' => '&#xe6ec;',
                'url' => '/roles/index',
                'created_at' => Carbon::now()->toDateTimeString(),
                'updated_at' => Carbon::now()->toDateTimeString(),
                'slug' =>'setting_permission_roles_show'
            ]

        ]);
    }
}
